import javax.servlet.ServletOutputStream;
import java.io.ByteArrayInputStream;
import java.io.ByteArrayOutputStream;
import java.io.IOException;

/**
 * Created with IntelliJ IDEA.
 * User: ttq
 * Date: 13-7-5
 * Time: 下午4:05
 * To change this template use File | Settings | File Templates.
 */
public class WaterMarkOutputStream extends ServletOutputStream {
    private ByteArrayOutputStream byteArrayOutputStream;

    public WaterMarkOutputStream() throws IOException {
        byteArrayOutputStream = new ByteArrayOutputStream();
    }

    public void write(int b) throws IOException {
        byteArrayOutputStream.write(b);
    }

    public void close() throws IOException {
        byteArrayOutputStream.close();
    }

    public void flush() throws IOException {
        byteArrayOutputStream.flush();
    }

    public void write(byte[] bytes, int off, int len) throws IOException {
        byteArrayOutputStream.write(bytes, off, len);
    }

    public void write(byte[] bytes) throws IOException {
        byteArrayOutputStream.write(bytes);
    }

    public ByteArrayOutputStream getByteArrayOutputStream() {
        return byteArrayOutputStream;
    }
}
